<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=0.5,minimum-scale=0.5,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>投诉</title>
    <link rel="stylesheet" type="text/css" href="__CSS__/api.css"/>
    <link rel="stylesheet" type="text/css" href="__CSS__/aui.css"/>
    <style>
        body {
            background-color: #F6F6F6 !important;
            outline: 0;
            padding-left: 23px;
            padding-right: 23px;
        }

        .outer {
            padding-top: 6px;
        }

        .label {
            display: inline-block;
            margin-top: 28px;
            height: 57px;
            line-height: 57px;
            padding-left: 20px;
            padding-right: 20px;
            color: #B1B1B1;
            font-size: 28px;
            border: 1px solid #DDDDDD;
            border-radius: 7px;
            margin-right: 41px;
        }

        .label2 {
            color: #DF4638;
            border: 1px solid #DF4638;
        }

        .outer1 {
            margin-top: 48px;
        }

        .outerr {
            border: 1px solid #DDDDDD;
        }

        .shuzi {
            font-size: 24px;
            color: #999999;
            padding-bottom: 19px;
            text-align: right;
            padding-right: 19px;
            background-color: #FFFFFF;
        }

        .advice {
            background-color: #FFFFFF;
            height: 293px;
            color: #292B38;
            font-size: 28px;
            padding: 20px 24px;
        }

        textarea::-webkit-input-placeholder,
        input::-webkit-input-placeholder {
            color: #B1B1B1;
            font-size: 28px;
        }

        input[type="text"] {
            height: 86px;
            width: 100%;
            background-color: #fff;
            color: #292B38;
            font-size: 28px;
            border: 1px solid #DDDDDD;
        }

        input[type="tel"] {
            height: 86px;
            width: 100%;
            background-color: #fff;
            color: #292B38;
            font-size: 28px;
            border: 1px solid #DDDDDD;
        }

        .submit {
            background: linear-gradient(-127deg, rgba(240, 64, 64, 1), rgba(255, 122, 122, 1));
            height: 92px;
            line-height: 92px;
            color: #FFFFFF;
            font-size: 36px;
            text-align: center;
            border-radius: 11px;
            margin-top: 64px;
        }
    </style>
    <style>
        .aui-bar-nav{
            /*background:#F81C6B;*/
            color:#000;
            width:100%;
            padding: 0;
            margin: 0;
            position: absolute;
            top:0;
            left: 0;
            height:2.4rem;line-height: 2.4rem;padding: 5px;
        }
        .aui-iconfont {
            position: relative;
            font-family: "aui_iconfont" !important;
            font-size: 1.2rem;
            font-style: normal;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            height: 2.4rem;
        }

        .aui-icon-tu{
            height: 2.4rem;
            width: 49px;
            background: url('__IMG__/left.png') no-repeat center center;
            background-size: 20px 35px;
        }
    </style>
</head>

<body>
<header class="aui-bar aui-bar-nav underLine" id="header">
    <a class="aui-pull-left" tapmode="active" onclick="window.history.back(-1);"> <span class="aui-iconfont aui-icon-tu"> </span> </a>
    <div class="aui-title" style="font-size: 1.2rem">投诉</div>
</header>
<div class="outer" style="margin-top: 2.5rem">
    <span class="label" tapmode onclick="selected(this);" idd='1'>虚假送达</span>
    <span class="label" tapmode onclick="selected(this);" idd='2'>商品质量差</span>
    <span class="label" tapmode onclick="selected(this);" idd='3'>服务态度差</span>
    <span class="label" tapmode onclick="selected(this);" idd='4'>配送速度慢</span>
</div>
<input type="hidden" id="tousu" value="" />
<div class="submit" tapmode onclick="toIntelNet();">提交</div>
</body>
<script type="text/javascript" src="__JS__/jquery.min.js"></script>
<script type="text/javascript">
    function selected(el) {
        var reason = $(el).text();
        $(el).addClass('label2').siblings().removeClass('label2');
        $('#tousu').val(reason);
    }
    function toIntelNet() {
        var reason = $('#tousu').val().trim();
        if(reason == ''){
            alert('请选择投诉内容');
            return false;
        }else{
            var parame = {
                reason: reason,
                order_id: {$oid},
            };
            $.ajax({
                url: '{:url("Orders/touSuOrder")}',
                data: parame,
                type: 'POST',
                dataType: 'json',
                success: function (returndata) {
                    if (returndata.status == 200) {
                        var type = {$type};
                        var oid = {$oid};
                        location.href = '{:url("Orders/myOrderInfo")}?order_id='+oid+'&type='+type;
                    } else {
                        alert(returndata.msg)
                    }
                },
                error: function () {
                    alert('Ajax error!');
                }
            })
        }

    }
</script>

</html>
